home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Die Speccy' 97
/
Die Speccy' 97.iso
/
amiga_system
/
the_aminet
/
util
/
rexx
/
tritonrexx376.lha
/
TritonRexx
/
Rexx
/
GadgetDemo.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-16
|
8KB
|
246 lines
/*
** $VER: TritonRexx Gadget-Demo 1.0 (2.8.95)
*/
/*
** Library mit *erh÷hter* *PrioritΣt* einbinden! Wenn noch andere
** Libraries eingebunden sind wird dies die Arbeitsgeschwindigkeit
** des Scripts positiv beeinflussen, da die 'tritonrexx.library'
** dann wegen ihrer PrioritΣt immer als erstes nach Funktionen
** durchsucht wird.
*/
IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
SAY 'Kann die <tritonrexx.library> nicht ÷ffnen!'
EXIT(10)
END
END
/*
** EintrΣge fⁿr das Cycle-Gadget
*/
cyclelist.0 = 3
cyclelist.1 = 'Hallo'
cyclelist.2 = 'Moin'
cyclelist.3 = 'Tach'
/*
** EintrΣge fⁿr das MX-Gadget
*/
mxlist.0 = 6
mxlist.1 = 'Amiga 500'
mxlist.2 = 'Amiga 600'
mxlist.3 = 'Amiga 1200'
mxlist.4 = 'Amiga 2000'
mxlist.5 = 'Amiga 3000'
mxlist.6 = 'Amiga 4000'
/*
** Definitionen
*/
apptags = 'TRCA_Name Gadgets',
'TRCA_LongName "TritonRexx Gadget-Demo"',
'TRCA_Info "Verschiedene Gadgets auf einen Blick!"',
'TRCA_Version "1.0"',
'TRCA_Release "1"',
'TRCA_Date "1.8.95"',
'TAG_END'
windowtags = WindowID(1),
WindowPosition('TRWP_CENTERDISPLAY'),
WindowTitle("Gadgets"),
'HorizGroupAC',
'Space',
'VertGroupA',
'Space',
NamedSeparator('Gadget deaktivieren'),
'Space',
Button('_Button',1),
'Space',
'HorizGroupSC',
'Space',
'HorizGroup',
TextID('_Knopf aktiv?',2),
'Space',
CheckBoxCLEFT(2),
'EndGroup',
'Space',
'EndGroup',
'SpaceB',
NamedSeparator('Werte anzeigen'),
'Space',
'LineArray',
'BeginLine',
TextID('Sc_roller',3) 'TRAT_Flags TROF_RIGHTALIGN',
'Space',
'TROB_Scroller TROF_HORIZ TRSC_Total 40 TRSC_Visible 10 TRAT_Value 5 TRAT_ID 3',
'Space',
ClippedTextBoxMW(5,30,2),
'EndLine',
'Space',
'BeginLine',
TextID('S_lider',4) 'TRAT_Flags TROF_RIGHTALIGN',
'Space',
SliderGadget(1,50,25,4),
'Space',
ClippedTextBoxMW(25,40,2),
'EndLine',
'Space',
'BeginLine',
TextID('C_ycle',5) 'TRAT_Flags TROF_RIGHTALIGN',
'Space',
CycleGadget('cyclelist',0,5),
'Space',
ClippedTextBoxMW(cyclelist.1,50,5),
'EndLine',
'EndArray',
'SpaceB',
NamedSeparator('Text eingeben'),
'Space',
'LineArray',
'BeginLine',
TextID('_String',6) 'TRAT_Flags TROF_RIGHTALIGN',
'Space',
StringGadget('Bitte Σndern',6),
GetEntryButton(60),
'EndLine',
'Space',
'BeginLine',
TextID('_Password',7) 'TRAT_Flags TROF_RIGHTALIGN',
'Space',
PasswordGadget('',7),
'EndLine',
'EndArray',
'Space',
'EndGroup',
'Space',
'VertSeparator',
'Space',
'VertGroupAC',
'Space',
NamedSeparatorI('Aus_wahl',8),
'Space',
MXGadget('mxlist',4,8),
'Space',
ClippedTextBox(mxlist.5,80),
'SpaceB',
NamedSeparatorI('D_oppelklick!',9),
'Space',
ListSS('mxlist',9,0,4),
'EndGroup',
'Space',
'EndGroup',
'EndProject'
/*
** Unterbrechungssignale
*/
SIGNAL ON break_c
SIGNAL ON failure
SIGNAL ON halt
SIGNAL ON ioerr
SIGNAL ON syntax
/*
** Fenster ÷ffnen und auswerten
*/
app = TR_CREATEAPP(apptags)
IF app ~= '00000000'x THEN DO
window = TR_OPENPROJECT(app,windowtags)
IF window ~= '00000000'x THEN DO
ende = 0
DO WHILE ~ende
CALL TR_WAIT(app,'')
DO WHILE TR_HANDLEMSG(app,'event')
IF event.trm_class = 'TRMS_NEWVALUE' THEN DO
SELECT
WHEN event.trm_id = 2 THEN
CALL TR_SETATTRIBUTE(window,1,'TRAT_Disabled',~event.trm_data)
WHEN event.trm_id = 3 THEN
CALL TR_SETATTRIBUTE(window,30,'TRAT_Text',event.trm_data)
WHEN event.trm_id = 4 THEN
CALL TR_SETATTRIBUTE(window,40,'TRAT_Text',event.trm_data)
WHEN event.trm_id = 5 THEN DO
nummer = event.trm_data+1
CALL TR_SETATTRIBUTE(window,50,'TRAT_Text',cyclelist.nummer)
END
WHEN event.trm_id = 8 THEN DO
nummer = event.trm_data+1
CALL TR_SETATTRIBUTE(window,80,'TRAT_Text',mxlist.nummer)
END
WHEN event.trm_id = 9 THEN DO
IF BITAND(D2X(event.trm_qualifier),'0200'x) = '0200'x THEN DO
nummer = event.trm_data
CALL TR_SETATTRIBUTE(window,8,'TRAT_Value',nummer)
nummer = nummer+1
CALL TR_SETATTRIBUTE(window,80,'TRAT_Text',mxlist.nummer)
END
END
OTHERWISE
NOP
END
END
IF event.trm_class = 'TRMS_ACTION' THEN DO
IF event.trm_id = 60 THEN DO
string = TR_GETATTRIBUTE(window,6,'TROB_String')
CALL TR_EASYREQUEST(app,'Inhalt des Eingabefeldes:'||'0a'x||string,'_Aha','TREZ_LockProject' C2D(window) 'TAG_END')
END
ELSE
CALL TR_EASYREQUEST(app,'Knopf betΣtigt, ID:' event.trm_id,'_Aha','TREZ_LockProject' C2D(window) 'TAG_END')
END
IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN
ende = 1
END
END
CALL TR_CLOSEPROJECT(window)
END
CALL TR_DELETEAPP(app)
END
EXIT(0)
/*******************************************************************************
** Routine, die bei einer Unterbrechung des Scripts aufgerufen wird
*******************************************************************************/
break_c:
failure:
halt:
ioerr:
syntax:
SAY '+++ Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc)
SAY SOURCELINE(sigl)
IF app ~= '00000000'x THEN
CALL TR_DELETEAPP(app)
EXIT(10)